package com.zbkj.crmeb.enums;

import org.apache.commons.lang3.StringUtils;

import java.util.Objects;

/**
 * 广交会-主营类目枚举
 * @Author: wangzh
 * @Date: 2023/4/14 14:44
 */
public enum MainCategoriesEnum {

    CLOTHING_AND_FOOTWEAR(1, "服饰鞋履"),

    BAG_ACCESSORIES(2, "包袋配饰"),

    PERSONAL_CARE(3, "个人护理"),

    IMPORTED_FOOD(4, "进口食品"),

    ALCOHOLIC_BEVERAGES(5, "酒水饮品"),

    BEAUTY_AND_DAILY_COSMETICS(6, "美妆日化"),

    MATERNAL_AND_CHILD_EDUCATION_AND_PLAY(7, "母婴教玩"),

    DIGITAL_HOME_APPLIANCES(8, "数码家电"),

    FURNITURE_LIFE(9, "家具生活"),

    MEDICAL_CARE(10, "医疗保健"),

    PET_LIFE(11, "宠物生活"),

    STATIONERY_ELECTRONIC_EDUCATION(12, "文具电教"),
    ;

    private final Integer code;

    private final String msg;

    MainCategoriesEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public static MainCategoriesEnum getEnum(String msg) {
        for (MainCategoriesEnum value : values()) {
            if (StringUtils.equals(msg, value.getMsg())) {
                return value;
            }
        }
        return null;
    }
}
